<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<!-- <script id="allmobilize" charset="utf-8" -->
<!-- 	src="<%=basePath%>js/allmobilize.min.js"></script> -->

<!--new top-->
<link rel="stylesheet" href="<%=basePath%>css/index.css">
<!--new top-->

<link rel="Stylesheet" type="text/css" href="<%=basePath%>css/home.css" />
<script src="<%=basePath%>js/jquery.js" type="text/javascript"></script>
<script src="<%=basePath%>js/home.js" type="text/javascript"></script>
<script src="<%=basePath%>js/plugins.js" type="text/javascript"></script>
<script type="text/javascript">
	function checkLogin(e){
		var userId=$.cookie("userId");
		if(userId==null||userId.trim()==""){
			e.href="<%=basePath%>login.jsp?link="+encodeURIComponent($(e).attr("link"));
		}else{
			e.href="<%=basePath%>" + $(e).attr("link");
		}
	}
</script>
</head>
<body>

	<div role="banner" class="blog-nav">
		<div class="container">
			<div role="navigation" class="navbar-collapse">
				<ul class="navbar-nav">
					<li class=active><a
						href="<%=basePath%>learning/learning.jsp" target="_top" title="">首页</a></li>
					<li><a href="<%=basePath%>learning/expert.jsp">博客专家</a></li>
					<li><a href="" class="rss"
						link="learning/myblog.jsp?page=bloglist"
						onclick="checkLogin(this)" target="_blank">我的专题</a></li>
					<li><a href="<%=basePath %>learning/search.jsp?type=1" target="_blank">搜索</a></li>
				</ul>
			</div>
		</div>
	</div>
	<div id="wrap">
		<div class="main_con">
<style type="text/css">
th {
	text-align: right;
	color: #777;
}

input {
	width: 220px;
}

#btnsub {
	width: 80px;
}

.err {
	padding-left: 10px;
	color: Red;
}
</style>
			<!-- //nav -->
			<script src="<%=basePath%>js/csdn.check.js" type="text/javascript"></script>
			<div class="main_con">
				<div class="way_nav">
					<a href="<%=basePath%>learning/expert.jsp">博客专家</a><em>&gt;</em><a
						href="<%=basePath%>learning/main_apply_expert.jsp">博客专家申请规则</a><em>&gt;</em><a
						href="#">博客专家申请</a>
				</div>
				<div class="bor_box rule">
					<h2>博客专家申请</h2>
					<p>尊敬的用户：</p>
					<p>感谢您对CSDN博客的支持！</p>
					<p>“博客专家”是系统给予质量较高、影响力较大的IT类博客的荣誉称号，代表了对其博客的肯定。成为博客专家后会得到我们一系列的服务，如
						在头像上加象征荣誉的专家勋章、有专人对接提供服务、文章获得更多的推荐机会、不定时获得CSDN的礼品等。</p>

					<dl>
						<dt>博客专家申请表</dt>
						<dd>
							<form action="<%=basePath%>ApplyExpertServlet" method="post"
								enctype="multipart/form-data" onsubmit="return subForm()">
								<table border="0" cellspacing="0" cellpadding="0">
									<colgroup>
										<col width="90" />
										<col width="500" />
										<col />
									</colgroup>
									<tr>
										<th><span class="must">*</span>真实姓名：</th>
										<td><input type="text" name="RealName" id="RealName"
											value="" class="input_1" /></td>
									</tr>
									<tr>
										<th><span class="must">*</span>上传照片：</th>
										<td><input id="file1" name="file1" type="file" /> <span
											style="font-size: 12px;">&nbsp;&nbsp;图片最大可支持2MB。该图片不会替代您的头像。</span>
										</td>
									</tr>
									<tr>
										<th><span class="must">*</span>手机：</th>
										<td><input type="text" name="Mobile" id="Mobile"
											class="input_1" value="" /></td>
									</tr>
									<tr>
										<th><span class="must">*</span>擅长领域：</th>
										<td><select name="Channe" id="ChannelId">
												<option value="">选择擅长的领域</option>
												<option value="mobile">移动开发</option>
												<option value="web">Web前端</option>
												<option value="enterprise">架构设计</option>
												<option value="code">编程语言</option>
												<option value="www">互联网</option>
												<option value="database">数据库</option>
												<option value="system">系统运维</option>
												<option value="cloud">云计算</option>
												<option value="software">研发管理</option>
										</select></td>
									</tr>
									<tr>
										<th><span class="must">*</span>擅长技术：</th>
										<td><input type="text" name="tag" id="tag"
											class="input_1" value="" /> <span style="font-size: 12px;">&nbsp;&nbsp;如：Android、JavaScript、Php、Oracle、搜索、Linux等技术，最多填写5个，用逗号隔开</span>
										</td>
									</tr>
									<tr>
										<th>QQ：</th>
										<td><input type="text" name="QQ" id="QQ" class="input_1"
											value="" /></td>
									</tr>
									<tr>
										<th><span class="must">*</span>邮寄地址：</th>
										<td><input type="text" name="Address" id="Address"
											class="input_2" value="" /></td>
									</tr>
									<tr>
										<th valign="top"><span class="must">*</span>个人简介：</th>
										<td><textarea name="Description" id="Description"
												cols="45" rows="5"></textarea></td>
									</tr>
									<tr>
										<th>&nbsp;<input type="hidden"
											value="${cookie.userId.value}" name="userId" /></th>
										<td><input class="btn" type="submit" value="提交申请" /> <span
											class="err" id="Sp_err"></span></td>
									</tr>
								</table>
							</form>
						</dd>
					</dl>
				</div>
			</div>
			<script language="javascript" type="text/javascript">
				$(function() {
					$(".nav_list a").eq(2).addClass("select");
				});

				var ext = '.jpg.jpeg.gif.bmp.png.';

				function subForm() {
					if (!$.cookie("userId")) {
						alert("请首先登录。");
						return false;
					}
					var DRealName = $.trim($("#RealName").val());
					if (DRealName.length == 0) {
						$("#Sp_err").html('请输入真实姓名');
						return false;
					}

					var f = document.getElementById("file1").value;

					if (f.length == 0) {
						$("#Sp_err").html("请选择一张照片。");
						return false;
					}
					f = f.substr(f.lastIndexOf('.')).toLowerCase();
					if (ext.indexOf(f + '.') == -1) {
						$("#Sp_err").html("图片格式不正确。");
						return false;
					}

					// 					var DEmail = $.trim($("#Email").val());
					// 					if (DEmail.length == 0) {
					// 						$("#Sp_err").html('请输入E_mail');
					// 						return false;
					// 					} else if (!csdn.checkEM(DEmail)) {
					// 						$("#Sp_err").html('请输入正确的E_mail');
					// 						return false;
					// 					}

					var DMobile = $.trim($("#Mobile").val());
					if (DMobile.length == 0) {
						$("#Sp_err").html('请输入手机号');
						return false;
					} else if (!csdn.checkMobile(DMobile)) {
						$("#Sp_err").html('请输入正确的手机号');
						return false;
					}

					// 					var DCity = $.trim($("#City").val());
					// 					if (DCity.length == 0) {
					// 						$("#Sp_err").html('请输入所在城市');
					// 						return false;
					// 					}

					// 					var DCompany = $.trim($("#Company").val());
					// 					if (DCompany.length == 0) {
					// 						$("#Sp_err").html('请输入所在公司');
					// 						return false;
					// 					}

					// 					var DTitle = $.trim($("#Title").val());
					// 					if (DTitle.length == 0) {
					// 						$("#Sp_err").html('请输入目前职位');
					// 						return false;
					// 					}

					var checkIndex = $("#ChannelId").get(0).selectedIndex;

					if (checkIndex == 0) {
						$("#Sp_err").html('请选择擅长领域');
						return false;
					}
					if ($.trim($('#tag').val()).length == 0) {
						$("#Sp_err").html('请输入擅长技术');
						return false;
					}
					if ($('#tag').val().split(/[,;，、]/g).length > 5) {
						$("#Sp_err").html('最多输入5个关键词');
						return false;
					}

					var DChanne = $.trim($("#ChannelId").val());

					var DAddress = $.trim($("#Address").val());
					if (DAddress.length == 0) {
						$("#Sp_err").html('请输入邮寄地址');
						return false;
					}

					var DDescription = $.trim($("#Description").val());
					if (DDescription.length == 0) {
						$("#Sp_err").html('请输入个人简介');
						return false;
					}

					$("#Sp_err").html('');

					return true;
				}

				function IsOK(content, Dusername) {
					$("#Sp_err").html(
							"<font color=green>" + content + "</font>");

					window.location.href = 'apply_blog_expert_success.html?user='
							+ Dusername;
				}

				function IsError(content) {
					$("#Sp_err").html(
							"<font color=green>" + content + "</font>");
				}

				function shower(err) {
					alert(err);
				}
			</script>

		</div>

<!-- 		<script type="text/javascript" src="<%=basePath%>js/cnick.js"></script> -->

	</div>
	<link href="<%=basePath%>css/ask_float_block.css" type="text/css"
		rel="stylesheet" />
	<script type='text/javascript'>
(function(){
$(function(){
	var back_top_value =Math.ceil(document.documentElement.clientHeight *0.65);
	var float_ask_img="<div data-mod='popu_64' class='tracking-ad' chg-blk='0' ><a id='com-d-top-a'  style='top:"+back_top_value+"px' title='返回顶部' onclick='' ></a> </div>";
	$("body").append(float_ask_img);
	
	var d_top = $('#com-d-top-a');

        $(document).scroll(function(){
            var scrTop = (document.body.scrollTop || document.documentElement.scrollTop);
            if (scrTop > 500)
            {
                d_top.show();
            } else
            {
                d_top.hide();
            }

        })
        $('#com-d-top-a').click(function ()
        {
            scrollTo(0, 0);
            this.blur();
            return false;
        });
});
})();
</script>

</body>
</html>
